{template 'phpcms','header'}
<script type="text/javascript" src="images/js/validator.js"></script>
<!--begin main-->
<div id="main">
	<div id="main_l">
		<!--位置导航-->
		<div id="position" class="bdr_1"><a href="">网站首页</a><a href="{$M[url]}index.php">友情链接</a></div>
		<form name="myform" method="get" action="{$M[url]}register.php">
		<table class="table_form" cellspacing="1" cellpadding="0">
		<caption>申请友情链接</caption>
		<tr> 
			<th>链接类型</th>
			<td><input type="radio" name="linktype" value="0" checked="checked" onclick="$('#logolink').hide()"> 文字链接
			<input type="radio" name="linktype" value="1" onclick="$('#logolink').show()"> Logo链接
			</td>
		</tr>
		<tr> 
			<th>所属分类</th>
			<td><select name='typeid' id='typeid' style="width:36%" 'require="true" compare=">0" datatype="compare" msg="请选择所属类别"'>
				{loop $datas $i $type}
				<option value='{$type[typeid]}'>{$type[name]}</option>
				{/loop}
				</select>
			</td>
		</tr>
		<tr> 
			<th>网站名称</th>
			<td><input type="text" name="name" id="name" value="" require="true" datatype="require"  msg="<font color='red'>网站名称不能为空</font>"></td>
		</tr>
		<tr> 
			<th>网站地址</th>
			<td><input type="text" name="url" value="http://" size="40"></td>
		</tr>
		<tr id="logolink" style="display:none"> 
			<th>Logo地址</th>
			<td><input type="text"  name="logo" value="http://" size="40"></td>
		</tr>
{if $M['enablecheckcode'] }
		<tr>
			<th>验证码</th>
			<td><input name="checkcodestr" type="text" size="4" id="code" require="true" datatype="require"  msgid="ccode" msg="验证码必须填写">
			  <img src="checkcode.php" id="checkcode" onclick="this.src='checkcode.php?id='+Math.random()*5;" style="cursor:pointer;" alt="验证码,看不清楚?请点击刷新验证码" align="absmiddle"/>
			  <span id="ccode"></span>
			</td>
		</tr>
{/if}
		<tr> 
			<th></th>
			<td><input type="submit" name="dosubmit" value=" 申 请 "> <input type="reset" name="reset" value=" 取 消 "> </td>
		</tr> 
		</table>
		</form>
	</div>
	<div id="main_r">
		<h4>友情链接分类</h4>
		<div id="link_cat">
		{loop $datas $i $type}
		<a href="link/index.php?typeid={$type[typeid]}">{$type[name]}</a>
		{/loop}
		</div>
	</div>
</div>
<script language="javascript">
<!--
	$('form').checkForm(1);
//-->
</script>
<!--end main-->
{template 'phpcms','footer'}